home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 16
/
Aminet 16 (1996)(GTI - Schatztruhe)[!][Dec 1996].iso
/
Aminet
/
dev
/
lang
/
uc_0_30.lha
/
u
/
rdocs
/
r0005.doc
< prev
next >
Wrap
Text File
|
1996-10-30
|
10KB
|
505 lines
**********************
* P R O J E C T < U >
*
* Author and copyright
* (c) 1996
* Paul van der Valk
*
* file: r0005.doc
* last updated: 30-oct-96
THE UCODE FORMAT
An UCode database (UCDB) is a subclass of a U Database (UDB).
This document describes the contents of the record-datablock. For a
complete image of the file structure please refer to r0004.doc.
The UDB-app fields are assigned assigned:
AppID: the hexadecimal constant DB1DEA01
AppUsr the ucode version, currently 2.
Each ucode-record has the following format:
NX RT P1 P2 P3 [A1 [A2 .. [AN]]] [STR]
Where:
NX is a unsigned 32 bits integer that points to the optional
next record in a chain.
RT is a unsigned 8 bits integer that defines the record type.
P1 is an 8 bits property. The meaning of this property depends
on the record type (RT). Undefined instances must have a value
of 0 for future compatibility.
P2 is an 8 bits property. See also P1.
P3 is an 8 bits property. See also P2.
A1..AN are 32 bits arguments. The amount and type of arguments
depends on the record type (RT).
STR is a null terminated sequence of characters, padded with zeros
to a 4-byte boundary. Whether a string is present depends on the
record type (RT).
LISTING OF UCODE RECORDS
* --- RECORD TYPE 0 - Undefined
NR RT P1 P2 P3
+----+--+--+--+--+
|next|00|--|--|--|
+----+--+--+--+--+
* Record type 0 is by definition undefined. Backends should report an
error when such record is encountered.
defined: 0.1
implemented
l uca2b: 0.1
umgk -l: 0.1
umgk -x: 0.1
* --- RECORD TYPE 1 - Header
NR RT P1 P2 P3 A1 A2 A3 A4
+----+--+--+--+--+----+----+----+----+
|next|01|--|--|--|root| -- | -- | -- |
+----+--+--+--+--+----+----+----+----+
defined: 0.1
implemented
l uca2b: 0.1
umgk -l: 0.1
umgk -x: 0.1
fields:
root - recordnumber of the UCODE tree.
* The header record appears only once in a UCDB and it must be
record number 1. This is the only record with such restriction.
* --- RECORD TYPE 2 - Module
NR RT P1 P2 P3 A1 A2 A3 A4 A5 A6 ATR
+----+--+--+--+--+----+----+----+----+----+----+-------+
|next|02|mt|--|--|body|defs|args|rslt|attr|rtf | name |
+----+--+--+--+--+----+----+----+----+----+----+-------+
defined: 0.1-0.30
implemented
l uca2b: 0.1
umgk -l: 0.1 only body & defs fields
umgk -x: 0.1 " "
fields:
mt - module type. Only 1 type defined as of v0.30:
0 = program
body - link to the first instruction.
defs - link to the first item in list of local definitions (i.e. vars).
args - link to first argument in the arglist.
rslt - link to the result description.
attr - attribute field, reserved for future use.
rtf - runtime field; do not touch.
name - the module name.
* --- RECORD TYPE 3 - Vardef
NR RT P1 P2 P3 A1 A2 A3 STR
+----+--+--+--+--+----+----+----+-------+
|next|03|dt|--|--|dtd |dta |rtf | name |
+----+--+--+--+--+----+----+----+-------+
defined: 0.1-0.30
implemented
uca2b: 0.1
umgk -l: 0.1 datatypes not yet supported
umgk -x: 0.1 " "
fields:
dt - the datatype
dtd - datatype datafield
rtf - runtime field - do not touch
name - the variable name
* --- RECORD TYPE 4 - Typedef
NR RT P1 P2 P3 A1 A2 A3 STR
+----+--+--+--+--+----+----+----+-------+
|next|04|dt|--|--|dtd |dta |rtf | name |
+----+--+--+--+--+----+----+----+-------+
defined: 0.30
implemented
uca2b: 0.30
umgk -l: not yet
umgk -x: not yet
fields:
dt - the datatype
dtd - datatype datafield
rtf - runtime field - do not touch
name - the datatype name
* --- RECORD TYPE 5 - Numeric constant
NR RT P1 P2 P3 A1
+----+--+--+--+--+----+
|next|05|--|--|--|val |
+----+--+--+--+--+----+
defined: 0.1
implemented
uca2b: 0.1
umgk -l: 0.1
umgk -x: 0.1
fields:
val - a signed 32 bit integer value.
* --- RECORD TYPE 6 - String constant
NR RT P1 P2 P3 STR
+----+--+--+--+--+-------+
|next|06|--|--|--|strdat |
+----+--+--+--+--+-------+
defined: 0.1
implemented
uca2b: 0.1
umgk -l: 0.1
umgk -x: 0.1
fields:
strdat - the string data.
* --- RECORD TYPE 7 - Call function
NR RT P1 P2 P3 A1 A2
+----+--+--+--+--+----+----+
|next|07|as|--|--|sfnr|argl|
+----+--+--+--+--+----+----+
defined: 0.1
implemented
uca2b: 0.1
umgk -l: 0.1
umgk -x: 0.1
fields:
as - API set. Possible values as of 0.30:
- 0 = standard API set.
* --- RECORD TYPE 8 - Call node
NR RT P1 P2 P3 A1 A2
+----+--+--+--+--+----+----+
|next|08|--|--|--|node|argl|
+----+--+--+--+--+----+----+
defined: 0.30
implemented
uca2b: 0.30
umgk -l: not yet
umgk -x: not yet
fields:
node - the node to be called.
argl - link to first item in arglist.
* --- RECORD TYPE 9 - If...then...else
NR RT P1 P2 P3 A1 A2 A3
+----+--+--+--+--+----+----+----+
|next|09|--|--|--|cond|texp|fexp|
+----+--+--+--+--+----+----+----+
defined: 0.1
implemented
uca2b: 0.1
umgk -l: 0.1
umgk -x: 0.1
fields:
cond - link to condition expression.
texp - link to TRUE expression.
fexp - link to FALSEE expression.
* --- RECORD TYPE 10 - While...do...
NR RT P1 P2 P3 A1 A2
+----+--+--+--+--+----+----+
|next|10|--|--|--|cond|body|
+----+--+--+--+--+----+----+
defined: 0.1
implemented
uca2b: 0.1
umgk -l: 0.1
umgk -x: 0.1
fields:
cond - link to condition expression.
body - link to expression body.
* --- RECORD TYPE 11 - Do...until...
NR RT P1 P2 P3 A1 A2
+----+--+--+--+--+----+----+
|next|11|--|--|--|cond|body|
+----+--+--+--+--+----+----+
defined: 0.1
implemented
uca2b: 0.30
umgk -l: not yet
umgk -x: not yet
fields:
cond - link to condition expression.
body - link to expression body.
* --- RECORD TYPE 12 - For...
format yet to be defined
* --- RECORD TYPE 13 - Labdef
NR RT P1 P2 P3 STR
+----+--+--+--+--+-------+
|next|13|--|--|--| label |
+----+--+--+--+--+-------+
defined: 0.1
implemented
uca2b: 0.1
umgk -l: 0.1
umgk -x: 0.1
fields:
label - the name of the label.
* --- RECORD TYPE 14 - Goto
NR RT P1 P2 P3 A1
+----+--+--+--+--+----+
|next|14|--|--|--|node|
+----+--+--+--+--+----+
defined: 0.1
implemented
uca2b: 0.1
umgk -l: 0.1
umgk -x: 0.1
fields:
node - node to jump to.
* --- RECORD TYPE 15 - Assignment
NR RT P1 P2 P3 A1 A2
+----+--+--+--+--+----+----+
|next|15|--|--|--|lexp|rexp|
+----+--+--+--+--+----+----+
defined: 0.1
implemented
uca2b: 0.1
umgk -l: 0.1
umgk -x: 0.1
fields:
lexp - link to var record.
rexp - expression of assignment.
* --- RECORD TYPE 16 - Varref
NR RT P1 P2 P3 A1
+----+--+--+--+--+----+
|next|16|--|--|--|var |
+----+--+--+--+--+----+
defined: 0.1
implemented
uca2b: 0.1
umgk -l: 0.1
umgk -x: 0.1
fields:
var - link to var record.
* --- RECORD TYPE 17 - Switch ...
NR RT P1 P2 P3 A1 A2 A3
+----+--+--+--+--+----+----+----+
|next|17|--|--|--|cond|list|dflt|
+----+--+--+--+--+----+----+----+
defined: 0.30
implemented
uca2b: 0.30 (iffy)
umgk -l: not yet
umgk -x: not yet
fields:
cond - link to condition expression
list - link to first item in CASE list
dflt - link to default expression
* --- RECORD TYPE 18 - Source formatting
NR RT P1 P2 P3
+----+--+--+--+--+
|next|18|mo|--|--|
+----+--+--+--+--+
defined: 0.30
implemented
uca2b: 0.30
umgk -l: 0.30
umgk -x: 0.30
fields:
mo - mode. Valid modes are:
0 = put next instruction on same line.
1 = insert a blank line.
* --- RECORD TYPE 19 - Source comment
NR RT P1 P2 P3 STR
+----+--+--+--+--+-------+
|next|19|mo|--|--|commen |
+----+--+--+--+--+-------+
defined: 0.30
implemented
uca2b: 0.30
umgk -l: 0.30
umgk -x: 0.30
fields:
mo - mode. Valid modes are:
0 = comment after instruction.
1 = comment on a newline, at column 1.
2 = comment on a newline, indented.
comment - the comment text.
* --- RECORD TYPE 20 - Unary operator
NR RT P1 P2 P3 A1
+----+--+--+--+--+----+
|next|20|op|--|--|expr|
+----+--+--+--+--+----+
defined: 0.30
implemented
uca2b: nothing to implement yet :)
umgk -l: " "
umgk -x: " "
fields:
op - the unary operator. Nothing defined sofar.
expr - link to expression to apply unary operator on.
* --- RECORD TYPE 21 - Binnary operator
NR RT P1 P2 P3 A1 A2
+----+--+--+--+--+----+----+
|next|20|op|--|--|exp1|exp2|
+----+--+--+--+--+----+----+
defined: 0.30
implemented
uca2b: 0.30
umgk -l: 0.30
umgk -x: 0.30
fields:
op - the binary operator. Valid operators are:
0 = plus (addition)
1 = minus (substraction)
2 = equal
3 = not equal
4 = greather than
5 = less than
6 = greater or equal
7 = less or equal
exp1 - link to left expression to apply binary operator on.
exp2 - link to right expression to apply binary operator on.